<template>
	<div class="wrapper">
		<h3 class="listTile">{{newsinfo.title}}</h3>
		<p class="timeClick">
			<span>{{newsinfo.add_time | dataFormat}}</span>
			<span>点击:{{newsinfo.click}}次</span>
		</p>
		<hr>
		<div class="container" v-html="newsinfo.content">
			
		</div>
		
		<comment-box :id=this.id></comment-box>
	</div>
</template>

<script>
	import comment from '../subcomponent/comment.vue'
	
	export default {
		data(){
			return{
				id:this.$route.params.id,
				newsinfo:[]
			}
		},
		created(){
			this.getNewsList()
		},
		methods:{
			getNewsList(){
				this.$http.get("api/getnew/"+this.id).then(result =>{
					if(result.body.status === 0){
						this.newsinfo = result.body.message[0];
					}else{
						Toast("获取失败");
					}
					
					
					
					
			})
		}
		
		
		
		
		
		
	},
	components:{
		"comment-box" : comment
	},
	}
</script>

<style lang="scss" scoped>
	.wrapper{
		padding: 0 4px;
		.listTile{
			font-size: 16px;
			text-align: center;
			color: red;
			margin: 15px 0;
		}
		.timeClick{
			display: flex;
			justify-content: space-between;
			color:#226aff;
		}
		.container{
			
			
		}
	}
</style>
